package studio.wetrack.dinner.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import studio.wetrack.dinner.domain.DishInventory;
import studio.wetrack.dinner.db.repo.DishInventoryRepo;
import studio.wetrack.dinner.db.repo.DishRepo;
import studio.wetrack.dinner.service.DishService;

import java.util.List;

/**
 * Created by zhanghong on 2017/8/12.
 */
@Service
public class DishServiceImpl implements DishService {

    @Autowired
    DishRepo dishRepo;

    @Autowired
    DishInventoryRepo dishInventoryRepo;

    @Override
    public List<DishInventory> getDishList() {
        List<DishInventory> dishInventoryList = dishInventoryRepo.findAll();
//        for (DishInventory dishInventory : dishInventoryList) {
//            dishInventory.setDish(dishRepo.findOne(dishInventory.getDishId()));
//        }
        return dishInventoryList;
    }
}
